﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Theme2
{
    public class Calculator1
    {
        public static double CalculateSalaryByLevel(int level)
        {
            double minCoef = Power(Program.SalaryBaseCoef, level);
            double maxCoef = Power(Program.SalaryBaseCoef, level + 1);
            double salary = Average(minCoef * Program.SalaryBaseValue, maxCoef * Program.SalaryBaseValue);
            return salary;
        }

        public static double Average(double a, double b)
        {
            double result = a + b / 2;
            return result;
        }

        public static double Power(double x, int n)
        {
            double result = 1;
            for (int i = 1; n > i; i++)
            {
                result = result * x;
            }
            return result;
        }
    }

    public class Calculator1_Stas_Zverev
    {
        public static double CalculateSalaryByLevel(int level)
        {
            double minCoef = Power(Program.SalaryBaseCoef, level);
            double maxCoef = Power(Program.SalaryBaseCoef, level + 1);
            double salary = Average(minCoef * Program.SalaryBaseValue, maxCoef * Program.SalaryBaseValue);
            return salary;
        }

        public static double Average(double a, double b)
        {
            double result = (a + b) / 2;
            return result;
        }

        public static double Power(double x, int n)
        {
            double result = 1;
            for (int i = 0; n > i; i++)
            {
                result = result * x;
            }
            return result;
        }
    }

    public class Calculator1_Sergey_Belopahov
    {
        public static double CalculateSalaryByLevel(int level)
        {
            double minCoef = Power(Program.SalaryBaseCoef, level);
            double maxCoef = Power(Program.SalaryBaseCoef, level + 1);
            double salary = Average(minCoef * Program.SalaryBaseValue, maxCoef * Program.SalaryBaseValue);
            return salary;
        }

        public static double Average(double a, double b)
        {
            double result = (a + b) / 2;
            return result;
        }

        public static double Power(double x, int n)
        {
            double result = 1;
            for (int i = 0; n > i; i++)
            {
                result = result * x;
            }
            return result;
        }
    }
}
